package cn.jhc.lifecycle;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by luyanfei on 16-2-29.
 */

public class LifeFragmentAdapter extends FragmentPagerAdapter {

    public LifeFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if(position == 0)
            return new FirstFragment();
        if(position == 1)
            return new SecondFragment();
        return null;
    }

    @Override
    public int getCount() {
        return 2;
    }
}
